/**
 * @Author : JiGuangJie
 * @Date : 2022/9/30
 * @Time : 10:15
 * @Version : 1.0.0
 * @Description :
 */
import PlotDraw from './core/PlotDraw';
import PlotEdit from './core/PlotEdit';
// import {PlotTypes} from './enum/PlotTypes';
import './scss/index.scss';

export {PlotTypes} from './enum/PlotTypes';
export {PlotTextBox} from './geometry';

class GisPlot {
    public plotDraw: PlotDraw;
    public plotEdit: PlotEdit;
    public plotLayer: any;

    constructor(map: any, options?: any) {
        // @ts-ignore
        map.addLayer(this.createPlotLayer());
        this.plotDraw = new PlotDraw(map, options);
        this.plotEdit = new PlotEdit(map, options);
    }

    /**
     * 创建标绘图层
     * @private
     */
    private createPlotLayer(): any {
        // @ts-ignore
        this.plotLayer = new ol.layer.Vector({
            name: 'plot-layer',
            // @ts-ignore
            source: new ol.source.Vector(),
            zIndex: 9998
        });
        return this.plotLayer;
    }
}

export {GisPlot};